<?php 

//TODO: fazer uma galeria de vídeos que possam ser inseridos videos do youtube

$this->headLink()->appendStylesheet($this->baseUrl('_css/galeria_fotos.css'));
$this->headScript()->appendFile($this->baseUrl('_js/jquery.multifile/jquery.form.js'));
$this->headScript()->appendFile($this->baseUrl('_js/jquery.multifile/jquery.MetaData.js'));
$this->headScript()->appendFile($this->baseUrl('_js/jquery.multifile/jquery.MultiFile.js'));
$this->headScript()->appendFile($this->baseUrl('_js/jquery.multifile/jquery.blockUI.js'));
$this->headScript()->appendFile($this->baseUrl('_js/app/admin/fotos.js'));
$this->headScript()->appendFile($this->baseUrl('_js/app/admin/crud.js'));
?>
<script type="text/javascript">
var urlControlador = '<?php echo $this->url; ?>';
var ultimaUrlLista = urlControlador + '/lista?p=1<?php echo $this->urlParams; ?>';
</script>
<div style="margin:30px;" id="tabLista">
	<div id="divMensagem" class="notification attention png_bg" style="display: none;">
		<a href="#" class="close"><img src="<?php echo $this->baseUrl('_img/icons/cross_grey_small.png'); ?>" title="Close this notification" alt="fechar" /></a>
		<div>
			This is a Content Box. You can put whatever you want in it. By the way, you can close this notification with the top-right cross.
		</div>
	</div>
	<form action="<?php echo $this->baseUrl('/admin/fotos/insere?&view=json'); ?>" method="post" enctype="multipart/form-data">
		<fieldset>
		   <div id="fotos" style="position:relative; float:left; width:100%;">
<?php 
if(!empty($this->rs)){	
	foreach($this->rs as $r){
?>
			  <div class="foto">
	              <div class="img">
					<?php echo $this->partial('youtube_video.phtml', array('url' => $r['video'], 'altura' => 200, 'largura' => 300)); ?>
	              </div>
	          </div>
<?php
	}
}	
?>
	
	           </div>
	           <div style="clear:both;"></div>
	           <div style="height:15px;"></div>
	
				<p>
				    <h3>Adicionar vídeos:</h3>
	
	            	<input  type="hidden" name="id_fk" id="<?php echo $this->idFk; ?>" value="<?php echo $this->idFk; ?>" />
				   	<input type="hidden"  name="secao" id="secao" value="<?php echo $this->secao; ?>" />
	           		 <input class="text-input {validate: {required: true}}" type="file" name="imagem[]" id="fileX" size="40" /><br /><input id="enviaVarios" class="button" type="submit" value="Enviar Arquivos" />
				    <div style="height:5px;"></div>
				    <small >*Obrigat&oacute;rio</small>
				    <div style="height:15px;"></div>
				</p>
	            <div>
				    <a style="cursor: pointer;" onclick="javascript:history.go(-1);" class="button">Voltar</a>
	            </div>
	            <div style="clear:both;"></div>
	 	</fieldset>    
	</form>
</div>